package com.wyl.mybatis.demo;

import com.wyl.mybatis.config.SqlSessionFactoryConfig;
import com.wyl.mybatis.entity.FullCity;
import com.wyl.mybatis.mapper.FullCityMapper;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.IOException;

/**
 * @Description
 * @Author WuYiLong
 * @Date 2024/3/14 14:47
 */
public class TypeHandlerDemo {

    private final static Logger log = LoggerFactory.getLogger(TypeHandlerDemo.class);

    public static void main(String[] args) throws IOException {
        SqlSessionFactory sqlSessionFactory = SqlSessionFactoryConfig.buildSqlSessionFactory();
        try (SqlSession sqlSession = sqlSessionFactory.openSession()) {
            FullCityMapper mapper = sqlSession.getMapper(FullCityMapper.class);
            FullCity fullCity = mapper.selectByName("广东省");
            log.info("数据json：{}", fullCity.getCreateTime());
        }
    }
}
